package com.example.testvolication.pojo.valid.annotation;

import com.example.testvolication.pojo.valid.validator.NameCheckValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author zhangs
 * @date 2022/5/18 14:10
 */
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER})
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = {NameCheckValidator.class})
public @interface NameCheck {

    String message() default "名称校验错误";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}

